<template>
	<view class="user-spread-order" :class="themeName">
		<!-- 分销订单 -->
		
		<!-- 
		 明细：pages/commission_details/commission_details
		 -->
		<tabs :current="active" @change="handleChange" bar-width="60" :is-scroll="false" :active-color="themeColor">
			<tab v-for="(item, index) in order" :key="index" :name="item.name">
				<spread-order :type="item.type" :i="index" :index="active"></spread-order>
			</tab>
		</tabs>
		
	</view>
</template>

<script>
	import {
		DistributionOrderEnum
	} from "@/utils/enum";
	import spreadOrder from '@/bundle/components/spread-order/spread-order.vue'
	export default {
		components: {
			spreadOrder
		},
		data() {
			return {
				order: [{
					name: this.$zhTran("全部"),
					type: DistributionOrderEnum['ALL'],
				}, {
					name: this.$zhTran("待返佣"),
					type: DistributionOrderEnum['WAIT_RETURN'],
				}, {
					name: this.$zhTran("已结算"),
					type: DistributionOrderEnum['HANDLED'],
				}, {
					name: this.$zhTran("已失效"),
					type: DistributionOrderEnum['INVALED'],
				}],
				active: DistributionOrderEnum['ALL']
			};
		},
		onLoad(options) {
			if (this.$Route.meta.atitle) {
				uni.setNavigationBarTitle({
					title: this.$zhTran(this.$Route.meta.atitle)
				})
			}

		},

		methods: {
			handleChange(index) {
				this.active = index
			},
		}
	};
</script>
<style>

</style>